/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.fee.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.fee.entity.Payment;
import com.jeeplus.modules.fee.mapper.PaymentMapper;

/**
 * 付款单Service
 * @author weisong
 * @version 2017-09-20
 */
@Service
@Transactional(readOnly = true)
public class PaymentService extends CrudService<PaymentMapper, Payment> {

	public Payment get(String id) {
		return super.get(id);
	}
	
	public List<Payment> findList(Payment payment) {
		return super.findList(payment);
	}
	
	public Page<Payment> findPage(Page<Payment> page, Payment payment) {
		return super.findPage(page, payment);
	}
	
	@Transactional(readOnly = false)
	public void save(Payment payment) {
		super.save(payment);
	}
	
	@Transactional(readOnly = false)
	public void delete(Payment payment) {
		super.delete(payment);
	}

	// 更新状态
	@Transactional(readOnly = false)
	public int updateStatusById(Integer status, String id) {
		return mapper.updateStatusById(status, id);
	}

	// 查询最大的单号和日期【用来生成单号】
	public Payment findPaymentNoAndPaymentDate(){
		return mapper.findPaymentNoAndPaymentDate();
	}
}